package adv6;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class IntTest2 {

	public static void main(String[] args) {
		try {
			// ultra edit
			DataOutputStream dout = new DataOutputStream(new FileOutputStream(
					"E:/作业/java56/4.txt"));
			dout.writeInt(10000);// 4
			dout.writeBoolean(2 > 1);// 1
			dout.writeDouble(Math.PI);// 8
			dout.writeChar(21016);// 2
			dout.close();
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

		// 读取出来
		try {
			DataInputStream din = new DataInputStream(new FileInputStream(
					"E:/作业/java56/4.txt"));
			System.out.println(din.readInt());
			System.out.println(din.readBoolean());
			System.out.println(din.readDouble());
			System.out.println(din.readChar());
			din.close();
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
	}

}
